package nl.hu.modellingengine.ribbon.client.places;


import nl.hu.modellingengine.shared.TokenAnalyser;

import com.google.gwt.place.shared.Place;
import com.google.gwt.place.shared.PlaceTokenizer;
import com.google.gwt.place.shared.Prefix;

public class ElementPositionChangePlace extends Place {
		
	private String token;

	
	public ElementPositionChangePlace(String token){
		this.token = token;
	}
	
	public String getToken(){
		return this.token;
	}
	
	public String getId(){
		return TokenAnalyser.getValueOfTokenByFieldName(token, "id");
	}
	
	public String getType(){
		return TokenAnalyser.getValueOfTokenByFieldName(token, "type");
	}
	
	@Prefix(value = "element") 
    public static class Tokenizer implements PlaceTokenizer<ElementPositionChangePlace> {
        @Override
        public String getToken(ElementPositionChangePlace place) {
            return place.getToken();
        }

        @Override
        public ElementPositionChangePlace getPlace(String token) {
            return new ElementPositionChangePlace(token);
        }
    }

}
